package com.neu.questionnaire_system.controller;


import com.neu.questionnaire_system.beans.ResponseEntity;
import com.neu.questionnaire_system.entity.Admin;
import com.neu.questionnaire_system.service.impl.AdminServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xingle
 * @since 2022-10-31
 */
@RestController
@RequestMapping("/admin")
@CrossOrigin
public class AdminController {

    @Autowired
    private AdminServiceImpl adminService;

    /**
     * created by libo 管理员登录
     * @param admin 传入管理员登录的用户名和密码
     * @return 返回统一封装对象
     */
    @RequestMapping("/loginAdmin")
    public ResponseEntity loginAdmin(@RequestBody Admin admin){
        return adminService.loginAdmin(admin);
    }
}
